package Igor_Dominiak;

public class Prostokat {
	private double x, y;

	public Prostokat(double x, double y) {
		this.x = x;
		this.y = y;
	}
	
	public Prostokat(Prostokat p) {
		x = p.x;
		y = p.y;
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	public void ustal_wartosc(double x, double y) {
		setX(x);
		setY(y);
	}

	public double pole(double x, double y) {
		return x * y;
	}

	public double dlugosc_przekatnej(double x, double y) {
		return Math.sqrt(x * x + y * y);
	}
}
